/**
 * 异常页面
 */
export interface IException {
    title: string
    description: string
    size: 'small' | 'medium' | 'large' | 'huge' // medium
    status:
        | 'info'
        | 'success'
        | 'warning'
        | 'error'
        | '404'
        | '403'
        | '500'
        | '418' // info
}

/**
 * 全局配置
 */
export interface IGlobalPinia {
    exception: IException
    headerHeight: number // 64
    gap: number // 24

    theme: 'dark' | 'light' | 'os'
}

/**
 * api返回数据格式
 */
export interface IResponse<T> {
    code: number
    message: string
    data: T
}

export type IRequestMethod = 'GET' | 'POST' | 'OPTIONS'

export interface IPageList<T> {
    total: number
    last_page: number
    per_page: number
    current_page: number
    data: T
}

export type IPageListParameter<T = unknown> = {
    page?: number
    limit?: number
} & T

export interface MockParams {
    url: string
    type: string
    body: string
}

/**
 * 验证码
 */
export interface ICaptcha {
    image: string
    expire: number
}

export interface IUpload {
    name: string
    src: string
    ext: string
}
